//
//  BTabBarController.m
//  BCTabbarDemo
//
//  Created by Wythe Zhou on 3/5/15.
//  Copyright (c) 2015 demo. All rights reserved.
//

#import "BTabBarController.h"
#import "AViewController.h"
#import "BViewController.h"
#import "CViewController.h"
#import "DViewController.h"


@implementation BTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor cyanColor];
    
    AViewController *avc = [[AViewController alloc] init];
    BViewController *bvc = [[BViewController alloc] init];
    CViewController *cvc = [[CViewController alloc] init];
    DViewController *dvc = [[DViewController alloc] init];
    
    NSArray *imageNames = @[@"tabbar_home", @"tabbar_invest", @"tabbar_me", @"tabbar_more"];
    NSArray *sImageNames = @[@"tabbar_home_s", @"tabbar_invest_s", @"tabbar_me_s", @"tabbar_more_s"];
    
    UITabBarItem *aItem = [[UITabBarItem alloc] initWithTitle:@"首页" image:[UIImage imageNamed:imageNames[0]] selectedImage:[UIImage imageNamed:sImageNames[0]]];
    UITabBarItem *bItem = [[UITabBarItem alloc] initWithTitle:@"投资" image:[UIImage imageNamed:imageNames[1]] selectedImage:[UIImage imageNamed:sImageNames[1]]];
    UITabBarItem *cItem = [[UITabBarItem alloc] initWithTitle:@"我" image:[UIImage imageNamed:imageNames[2]] selectedImage:[UIImage imageNamed:sImageNames[2]]];
    UITabBarItem *dItem = [[UITabBarItem alloc] initWithTitle:@"设置" image:[UIImage imageNamed:imageNames[3]] selectedImage:[UIImage imageNamed:sImageNames[3]]];
    
    avc.tabBarItem = aItem;
    bvc.tabBarItem = bItem;
    cvc.tabBarItem = cItem;
    dvc.tabBarItem = dItem;
    
    self.viewControllers = @[avc, bvc, cvc, dvc];
}

@end
